package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.GiftListBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class GetGiftsMethods extends BaseMethods {

    private static GetGiftsMethods m_ins = null;

    public static GetGiftsMethods getInstance() {
        if (m_ins == null) {
            synchronized (GetGiftsMethods.class) {
                if (m_ins == null) {
                    m_ins = new GetGiftsMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Index/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void goodsList(Subscriber<GiftListBean> subscriber
                    ,int page ) {
        Observable observable = initService().goodsList(System.currentTimeMillis()+"",
                "ba83adc9ac87be55baf2966d4f5408cd",page
        );
        toSubscribe(observable, subscriber);
    }
}
